package etcMycat.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import etcMycat.entity.ETCToSZ;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CarMapper extends BaseMapper<ETCToSZ> {


    @Select("SELECT SUBSTRING(CP, 1, 1) AS 'province', COUNT(*) AS count\n" +
            "            FROM etc\n" +
            "            GROUP BY province\n" +
            "            order by count desc")
    List<ETCToSZ> from();

    @Select("select CX,count(CX) as 'count' " +
            "from etc " +
            "group by CX " +
            "order by count desc ")
    List<ETCToSZ> cxcount();
}
